//
//  YLSettingViewController.m
//  TheTenthAnniversaryOfMobileUnion
//
//  Created by kuangbiao on 2019/1/24.
//  Copyright © 2019 kuangbiao. All rights reserved.
//

#import "YLSettingViewController.h"
#import "YLManualCheckinViewController.h"
#import "Header.h"
@interface YLSettingViewController ()
@property (weak, nonatomic) IBOutlet UILabel *userNameLabel;

@end

@implementation YLSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
}

- (void)initView{
    self.navigationItem.title = @"设置";
    self.view.backgroundColor = [UIColor colorWithHexString:@"f6f6f6"];
    self.hiddenSetBtn = YES;
    self.userNameLabel.text = [CMBasicData getMerInfo].loginUserName?:@"";
}
#pragma mark - 人工签到
- (IBAction)manualCheckBtnClickAction:(id)sender {
    YLManualCheckinViewController *manualVC = [[YLManualCheckinViewController alloc] initWithNibName:@"YLManualCheckinViewController"
                                                                                              bundle:nil];
    [self.navigationController pushViewController:manualVC animated:YES];
}
#pragma mark - 退出登录
extern NSString *kServerHttpBaseUrl;
- (IBAction)exitBtnClickAction:(id)sender {
    
    NSString *url = [NSString stringWithFormat:@"%@%@",kServerHttpBaseUrl,kExit_url];
    [HttpRequest requestWithURLString:url parameters:nil type:HttpRequestTypePost success:^(id responseObject) {
        NSDictionary *dict = responseObject;
        YLHttpModel *httpModel = [YLHttpModel yy_modelWithDictionary:dict];
        if([httpModel.status isEqualToString:@"200"]){
            [self.navigationController popToRootViewControllerAnimated:YES];
        }else{
            [KDAlertView alertWithMessage:httpModel.msg?:@""];
        }
        
    } failure:^(NSError *error) {
        [KDLoadFrame withState:KDLoadStateError];
    }];
}

@end
